{% extends 'base.html' %}

{% load static %}
{% load viewflow %}

{% block title %}
Timesheet Approval
{% endblock %}

{% block main_content %}

<div class="row">
    <div class="col-md-10">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">{{ activation.task.flow_task.task_title }}</h3>
            </div>
            <div class="box-body">
                <dl class="dl-horizontal">
                    <dt>User</dt>
                    <dd>{{ activation.process.sheet.requester }}</dd>
                    <dt>Date</dt>
                    <dd>{{ activation.process.sheet.date }}</dd>
                    <dt>Code</dt>
                    <dd>{{ activation.process.sheet.code }}</dd>
                    <dt>Status</dt>
                    <dd>{{ activation.process.sheet.approval_status }}</dd>
                    <dt>Payroll</dt>
                    <dd>{{ activation.process.sheet.payroll }}</dd>
                </dl>
            </div>
            <div class="box-body">
                <form method="post" class="form form-inline">
                    {% csrf_token %}
                    {{ form }}
                    {{ activation.management_form }}
                </div>
                <div class="box-footer">
                    <a href="unassign" class="btn btn-primary">Unassign</a>
                    <button type="submit" name="_start" class="btn btn-primary">Save</button>
                    <button type="submit" name="_continue" class="btn btn-success">Submit</button>

                    <a href="{% url 'example:tasks_in_progress' %}" class="btn btn-default">
                        <span class="glyphicon glyphicon-tasks"></span> Tasks
                    </a>
                    <a href="{% url 'example:index' %}" class="btn btn-default">
                        <span class="glyphicon glyphicon-home"></span> Home
                    </a>
                    {% flowurl activation.task 'unassign' user=request.user as unassign_url %}
                    {% if unassign_url %}
                    <a href="{{ unassign_url }}?{{ task }}" class="btn btn-primary">Unassign</a>
                    {% endif %}
                </div>
            </div>
        </form>
    </div>
</div>
{% endblock main_content %}
